package com.dyh.quickdemozwei.ccclinet;

import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: yhdong
 * @Date: 2021/12/21 13:22
 */
@Slf4j
@Setter@Getter@RequiredArgsConstructor
public class ClientC2 {

    @NonNull
    ClientC1 clientC1;
    @NonNull
    AutoSessionSevc autoSessionSevc;

    public String send(String in){
        String result = null;
        try {
            result = clientC1.send(in);
        } catch (Exception e) {
            log.error("e=",e);
        }
        if ("fail".equals(result))
            autoSessionSevc.autoSession();
        return result;
    }
}
